package com.vision.bigDataApi.utils;

import com.vision.bigDataApi.config.ObjectMapperDateFormatExtend;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.fasterxml.jackson.databind.ObjectMapper;

import java.text.DateFormat;
import java.text.SimpleDateFormat;

/**
 * 功能说明：jackson配置类，用于生成ObjectMapper，在此进行json mapper的配置
 *
 * 
 */
@Configuration
public class JacksonMapper{
	@Bean
	public ObjectMapper getMapper(){
		ObjectMapper objectMapper = new ObjectMapper();
		/*objectMapper.registerModule(new JSR310Module());
		objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"));*/
		/*DateFormat dateFormat = objectMapper.getDateFormat();
		objectMapper.setConfig(objectMapper.getDeserializationConfig().with(new ObjectMapperDateFormatExtend(dateFormat)));*/
		return objectMapper;
	}
}
